package com.authenticateCenter.domain.vo;

import com.authenticateCenter.domain.entity.AuthorityModule;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 类似文件和目录的层级关系
 * @author 大忽悠
 * @create 2022/10/19 15:08
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AuthorityModuleVo {
    private Integer id;

    private String name;

    private String description;

    private Integer enabled;

    private Integer parentId;
    /**
     * 当前资源模块下的资源列表
     */
    private List<AuthorityVo> authorityVoList;

    /**
     * 当前资源模块下的资源模块
     */
    private List<AuthorityModuleVo> authorityModuleVoList;

    public void copyAuthorityModule(AuthorityModule authorityModule) {
           enabled=authorityModule.getEnabled();
           name=authorityModule.getName();
           id=authorityModule.getId();
           parentId=authorityModule.getParentId();
           description=authorityModule.getDescription();
    }
}
